<template>
  <div class="ly-menu">
    <el-radio-group v-model="isCollapse" style="margin-bottom: 20px;" v-if="false">
      <el-radio-button :label="false">展开</el-radio-button>
      <el-radio-button :label="true">收起</el-radio-button>
    </el-radio-group>
    <el-menu default-active="1-4-1" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose" :collapse="isCollapse" :router="true">
      <el-menu-item  index="/test-table-list">
        <template slot="title">
          <i class="fa fa-list"></i>
          <span slot="title">列表测试</span>
        </template>
      </el-menu-item >
    </el-menu>
  </div>
</template>

<script>
export default {
  name: 'ly-menu',
  data () {
    return {
      isCollapse: false
    }
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    }
  }
}
</script>

<style scoped lang="less">
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 200px;
  min-height: 400px;
}
.ly-menu{
  height:100%;
  background: #eef1f6;
  .fa{
    width:24px;
    margin-right: 5px;
    text-align: center;
  }
}
</style>
